package com.weixue.dao;

import com.weixue.entity.MallUser;
import com.weixue.utils.PageQueryUtil;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Day34
 *      用户登录和注册的Mapper接口
 */
public interface MallUserMapper {

    /**
     * 1.保存一条新记录
     */
    int insertSelective(MallUser record);

    /**
     * 2.根据loginName查询记录
     */
    MallUser selectByLoginName(String loginName);

    /**
     * 3.根据loginName和密码字段查询记录
     */
    MallUser selectByLoginNameAndPasswd(@Param("loginName") String loginName, @Param("password") String password);

    int deleteByPrimaryKey(Long userId);

    int insert(MallUser record);

    MallUser selectByPrimaryKey(Long userId);



    int updateByPrimaryKeySelective(MallUser record);

    int updateByPrimaryKey(MallUser record);

    List<MallUser> findMallUserList(PageQueryUtil pageUtil);

    int getTotalMallUsers(PageQueryUtil pageUtil);

    int lockUserBatch(@Param("ids") Integer[] ids, @Param("lockStatus") int lockStatus);
}